%a) 

n = 100;
probOneRecieve = 0.33;
cdfOnes = 0;

figure(1);
hold on;
title('PMF ones received');
axis([0 n 0 0.1]);

figure(2);
hold on;
title('CDF ones received');
axis([0 n 0 1]);

for i = 0:n
    pmfOnes = nchk(n,i)*(probOneRecieve^i)*((1-probOneRecieve)^(n-i));
    cdfOnes = cdfOnes + pmfOnes;
    figure(1);
    stem(i,pmfOnes);
    figure(2);
    plot(i,cdfOnes, '*');
end;
